////
////  HomeSectionHeaderView.swift
////  HengYouCai
////
////  Created by lwj on 2017/11/9.
////  Copyright © 2017年 lwj. All rights reserved.
////
//

import UIKit

class HomeSectionHeaderView: UITableViewHeaderFooterView {
    
    override init(reuseIdentifier: String?) {
        super.init(reuseIdentifier: reuseIdentifier)
        self.backgroundColor = Normal_458Color
        
        let bgView = UIView(frame: CGRect(x: 0, y: 0, width: JCWSCREENW, height: 40))
        bgView.backgroundColor = UIColor.white
        self.addSubview(bgView)
        
        bgView.wl_clipCorner([.topLeft,.topRight], 5)
        
        let redView = UIImageView()
        redView.image = UIImage(named: "home_rectangle")
        bgView.addSubview(redView)
        
        _ = redView.sd_layout().centerYEqualToView(bgView)?
            .heightIs(15)?
            .leftSpaceToView(bgView,15)?
            .widthIs(4)
        
        
        
        bgView.addSubview(self.titlelLab)
        _ = titlelLab.sd_layout()
            .leftSpaceToView(redView,7)?
            .centerYEqualToView(bgView)?
            .heightIs(16)?
            .autoWidthRatio
        titlelLab.setSingleLineAutoResizeWithMaxWidth(JCWSCREENW)
        
        
        bgView.addSubview(bottomLineView)
        _ = bottomLineView.sd_layout()
            .bottomSpaceToView(bgView,0)?
            .rightSpaceToView(bgView,0)?
            .leftSpaceToView(bgView,0)?
            .heightIs(0.5)
    }
    lazy var bottomLineView: UIView = {
        let lineView = UIView()
        lineView.backgroundColor = UIColor.white
        return lineView
    }()
    lazy var titlelLab: UILabel = {
        let title = UILabel()
        title.font = BoldFont_WL(16)
        title.textColor = Normal_333Color
        title.textAlignment = .left
        title.text = ""
        return title
    }()
    
    lazy var tagsView: JCWActiveTagView = {
        let tagView = JCWActiveTagView(UIColor.white, true, "")
        return tagView
    }()
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
}
